package com.sxhuayuan.parking.service;

import com.sxhuayuan.parking.compenent.Page;
import com.sxhuayuan.parking.compenent.Pageable;
import com.sxhuayuan.parking.entity.Agent;
import com.sxhuayuan.parking.entity.MonthlyProfit;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 代理分润月结算
 * 
 * @author 何龙
 * @create 2019-05-22 17:25
 */
public interface MonthlyProfitService extends BaseService<MonthlyProfit, Long> {

	/**
	 * 根据分页条件和代理查询分润列表
	 * 
	 * @param pageable
	 *            分页条件
	 * @param agent
	 *            代理
	 */
	Page<MonthlyProfit> findByPageable(Pageable pageable, Agent agent);

	/** 根据代理与分页条件进行分润统计 */
	BigDecimal[] sumByPage(Pageable pageable, Agent agent);

	/** 根据代理与月份查询代理月分润统计 */
	MonthlyProfit findByAgentAndStatistisMonth(Agent agent, LocalDate month);
}
